<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head lang="en">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<%@include file="style.jsp" %>
    <%@include file="script.jsp" %>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/orderlang/distributor/css/message_manage.css"/>
    <title>留言管理</title>
</head>
<body onselectstart="return false">
	<div id="container_1" style="height:100%">
	    <div style="position: relative">
	        <%@include file="header.jsp" %>
	    </div>
	    <div id="content" class="clearfix">
	        <%@include file="left_menu.jsp" %>
	        <!--内容部分-->
	        <div class="right-content" style="margin:75px 50px 0 213px;">
	            <p class="brand">
	                <a>客户</a>><a href="#">留言</a>><a class="now">留言管理</a>
	            </p>
	            <div class="content">
	                <div class="top-block">
	                    <div class="search-box fl">
	                    	<form action="${pageContext.request.contextPath}/message/getMessageByMessage" method="post" id="message">
	                        <input type="text" placeholder="搜索留言内容" name="message"/>
	                        <span onclick="submitForm1()"></span>
	                        </form>
	                    </div>
	                    <div class="select-box fl">
	                        <span class="fl">留言客户</span>
	                        <form action="${pageContext.request.contextPath}/message/getMessageByName" method="post" id="name">
	                        <div class="fl">
	                            <input type="text" readonly class="show"/>
	                            <input type="text" name="customerName" class="hidden" readonly/>
	                            <span>▼</span>
	                            <ul class="hide">
	                            	<c:forEach items="${messageName}" var="messageName">
		                                <li data-id="${messageName}">${messageName}</li>
	                                </c:forEach>
	                            </ul>
	                        </div>
	                        </form>
	                    </div>
	                    <div class="date fl">
	                        <input id="datePicker" readonly type="text" placeholder="请选择留言日期" onchange="changes()"/>
	                    </div>
	                </div>
	                <div class="message-list">
	                    <table>
	                        <thead>
	                            <tr>
	                                <td></td>
	                                <td>留言内容</td>
	                                <td>留言客户</td>
	                                <td>留言时间</td>
	                                <td></td>
	                            </tr>
	                        </thead>
	                        <tbody>
	                        	<c:forEach items="${messageList}" var="messageList" varStatus="i">
		                            <tr>
		                                <td>${i.index+1}</td>
		                                <td>${messageList.message}</td>
		                                <td>${messageList.customer.name}</td>
		                                <td><fmt:formatDate value="${messageList.createTime}" type="both" pattern="yyyy-MM-dd   hh:mm"/></td>
		                                <td>
		                                    <button class="reply"><a href="${pageContext.request.contextPath}/message/updateMessage?id=${messageList.id}">回复</a></button>
		                                    <button class="delete"><a href="${pageContext.request.contextPath}/message/deleteMessage?id=${messageList.id}">删除</a></button>
		                                </td>
		                            </tr>
	                            </c:forEach>
	                        </tbody>
	                    </table>
	                </div>
	            </div>
	        </div>
	        <script src="${pageContext.request.contextPath}/static/orderlang/distributor/js/message_manage.js"></script>
	        <!--内容部分结束-->
	    </div>
	</div>

</body>
</html>